           for (int @{mbe_id_low}Index = 0; @{mbe_id_low}Index < @{mbe_id_low}Length; @{mbe_id_low}Index++) {
                UMJSONContext @{mbe_id_low}Context = new UMJSONContext((JSONObject) @{mbe_id_low}Array.get(@{mbe_id_low}Index));
                @{mbe_fieldset_ctx}
                @{mbe_for}
                @{mbe_ctx_set}
                String @{mbe_id_low}tatus = @{mbe_id_low}Context.getValue(Entity.StatusField).toString();
                Long @{mbe_id_low}Recid = @{mbe_id_low}Context.getValue(Entity.IDField) != null
                        && !"".equalsIgnoreCase(@{mbe_id_low}Context.getValue(Entity.IDField).toString()) ? Long
                        .valueOf(@{mbe_id_low}Context.getValue(Entity.IDField).toString()) : 0l;
                @{mbe_id_upper}ExtendContextMapping mapping;
                if (EntityStatus.AddNew.toString().equalsIgnoreCase(@{mbe_id_low}tatus)) {
                    Entity entity = new EntityFinder("@{mbe_fieldset_from}").create();
                    mapping = new @{mbe_id_upper}ExtendContextMapping(new UMEntityContext(entity), @{mbe_id_low}Context);
                    mapping.remapping();
                    session.addNew(entity);
                    mapping.mapping();
                    @{mbe_id_low}Contexts.add(@{mbe_id_low}Context);
                } else if (EntityStatus.Deleted.toString().equalsIgnoreCase(@{mbe_id_low}tatus)) {
                    Entity entity = new EntityFinder("@{mbe_fieldset_from}").findById(@{mbe_id_low}Recid);
                    if (entity.getVersion() == Integer.valueOf(@{mbe_id_low}Context.getValue(Entity.VersionField).toString())) {
                        session.addDelete(entity);
                    } else {
                        throw new ContextStatusException("Versionno is wrong. Pls refresh page!");
                    }

                } else if (EntityStatus.Modified.toString().equalsIgnoreCase(@{mbe_id_low}tatus)) {
                    Entity entity = new EntityFinder("@{mbe_fieldset_from}").findById(@{mbe_id_low}Recid);
                    if (entity.getVersion() == Integer.valueOf(@{mbe_id_low}Context.getValue(Entity.VersionField).toString())) {
                        mapping = new @{mbe_id_upper}ExtendContextMapping(new UMEntityContext(entity), @{mbe_id_low}Context);
                        mapping.remapping();
                        session.addModified(entity);
                        mapping.mapping();
                        @{mbe_id_low}Contexts.add(@{mbe_id_low}Context);
                    } else {
                        throw new ContextStatusException("Versionno is wrong. Pls refresh page!");
                    }

                } else if (EntityStatus.Unchanged.toString().equalsIgnoreCase(@{mbe_id_low}tatus)) {
                    @{mbe_id_low}Contexts.add(@{mbe_id_low}Context);
                }
           }   